package com.cly.feign;

import com.cly.domain.Sku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient(value = "product-service")
public interface OrderProductFeign {

    /**
     * 远程调用根据skuIds 查询sku集合
     * @param skuIds
     * @return
     */
    @PostMapping("prod/prod/getSkuListByIds")
    List<Sku> getSukListByIds(@RequestBody List<Long> skuIds);

    /**
     * 远程调用修改库存
     * @param map
     */
    @PostMapping("prod/prod/changeStock")
    void changeStock(@RequestBody Map<String, Map<Long, Integer>> map);
}
